//
//  YCTitleContentView.h
//  DemoTitleContent
//
//  Created by tangkexiong on 15/9/2.
//  Copyright (c) 2015年 tangkexiong. All rights reserved.
//

#import <UIKit/UIKit.h>

@class YCTitleContentView, YCTitleContentViewCell;

/**
 *  协议-获取视图事件处理的回调
 */
@protocol YCTitleContentViewDelegate <NSObject>


@end

/**
 *  协议-获取视图显示需要的内容和设置
 */
@protocol YCTitleContentViewSource <NSObject>

@optional
/// 标签数量
- (NSInteger)numberOfCellsInTitleContentView:(YCTitleContentView *)titleContentView;
/// 标签的宽度
- (CGFloat)widthOfCellInTitleContentView:(YCTitleContentView *)titleContentView;
/// 标签栏的高度
- (CGFloat)heightOfTitleContentView:(YCTitleContentView *)titleContentView;
/// 标签的选中效果控件的高度
- (CGFloat)heightOfSelectViewInTitleContentView:(YCTitleContentView *)titleContentView;
/// 标签的选中效果控件
- (UIView *)selectViewInTitleContentView:(YCTitleContentView *)titleContentView;

/// 配置标签
- (void)titleContentView:(YCTitleContentView *)titleContentView cell:(YCTitleContentViewCell *)cell atIndex:(NSInteger)index;
/// 配置标签对应的视图控制器
- (UIViewController *)titleContentView:(YCTitleContentView *)titleContentView contentVCForIndex:(NSInteger)index;
@end

#pragma mark - YCTitleContentView

/**
 *  实现Title-Content模式的自定义视图，可以通过手势切换视图
 */
@interface YCTitleContentView : UIView

/// 设置代理
@property (nonatomic, assign) id<YCTitleContentViewSource> dataSource;
/// 动作代理
@property (nonatomic, assign) id<YCTitleContentViewDelegate> delegate;
/// 选中的第几个
@property (nonatomic, assign) NSInteger selectedIndex;

@end

#pragma mark - YCTitleContentViewCell 

@interface YCTitleContentViewCell : UICollectionViewCell

@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIView *selectedView;

@end
